/*
 * Created on Jul 8, 2004
 *
 * The contents of this file are subject to the Mozilla Public License
 * Version 1.1 (the "License");  you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 * http//www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
 * the specific language governing rights and limitations under the License.
 *
 * The Original Code is MAPONTO.
 *
 * The Initial Developer of the Original Code is University of Toronto. Portions
 * created by University of Toronto are Copyright (C) 2004.  All Rights Reserved.
 *
 * MAPONTO was developed by Knowledge Management Lab
 * (http//www.cs.toronto.edu/km) at the University of Toronto Department of 
 * Computer Science. Current information about MAPONTO can be obtained at 
 * http//resi.ai.toronto.edu:8080
 *
 */

 /*
  * Contributor(s): Yuan An yuana@cs.toronto.edu
 */
package main.model;

import java.io.Serializable;

/**Representation of lower and upper cardinality.
 * @author Yuan An
 */
public class Cardinality implements OntoEle, Serializable{
	public static final int INFINITY=-1;
	private int lower;
	private int upper;
	
	public Cardinality(){
		lower=0;
		upper=INFINITY;
	}
	
	public Cardinality(int lower){
		this.lower=lower;
		upper=INFINITY;
	}
	
	public Cardinality(int lower, int upper){
		this.lower=lower;
		this.upper=upper;
	}
	
	public void setLower(int lower){
		this.lower=lower;
	}
	
	public void setUpper(int upper){
		this.upper=upper;
	}
	
	public int getLower(){
		return lower;
	}
	
	public int getUpper(){
		return upper;
	}
	
	public String getName(){
		
		return "Cardinality";
	}
	
	public String display(){
		 
		return "(" + lower + "," + upper + ")";
	}
}
